﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WPS.SDK.exception
{
    public class YunHttpIOException:YunException
    {
        private bool bSocketTimeout = false;
        private bool bSocket = false;
        private bool bConnect = false;

        public YunHttpIOException(IOException e)
            :base(e)
        {
            //if ((e instanceof SocketTimeoutException)) {
            //    this.bSocketTimeout = true;
            //} else if ((e instanceof ConnectException)) {
            //    this.bConnect = true;
            //} else if ((e instanceof SocketException)) {
            //    this.bSocket = true;
            //}
        }

        public bool needRetry()
        {
            return true;
        }

        public bool isSocketTimeoutException()
        {
            return this.bSocketTimeout;
        }

        public bool isSocketException()
        {
            return this.bSocket;
        }

        public bool isConnectException()
        {
            return this.bConnect;
        }
    }
}
